import Vue from 'vue'
import VueRouter from 'vue-router'
import Music from 'views/music/music';
import Read from 'views/read/read';
import Share from 'views/share/share';
Vue.use(VueRouter)

const routes = [
  {
    path: '/music',
    name: 'Music',
    meta: { showTabBar: true },
    component: Music
  },
  {
    path: '',
    redirect: '/music'
  },
  {
    path: '/read',
    name: 'Read',
    meta: { showTabBar: true },
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    // component: () => import(/* webpackChunkName: "about" */ 'views/read/read')
    component: Read
  },
  {
    path: '/share',
    name: 'Share',
    meta: { showTabBar: true },
    component: Share
  },
  {
    path: '/signin',
    name: 'Signin',
    meta: { showTabBar: false },
    component: () => import('views/signin/signin')
  },
  {
    path: '/register',
    name: 'Register',
    meta: { showTabBar: false },
    component: () => import('views/register/register')
  },
]

const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router
